package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.EcdDesignCostMapper;
import com.ruoyi.system.domain.EcdDesignCost;
import com.ruoyi.system.service.IEcdDesignCostService;

/**
 * 设计成本Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-11
 */
@Service
public class EcdDesignCostServiceImpl implements IEcdDesignCostService 
{
    @Autowired
    private EcdDesignCostMapper ecdDesignCostMapper;

    /**
     * 查询设计成本
     * 
     * @param id 设计成本主键
     * @return 设计成本
     */
    @Override
    public EcdDesignCost selectEcdDesignCostById(Long id)
    {
        return ecdDesignCostMapper.selectEcdDesignCostById(id);
    }

    /**
     * 查询设计成本列表
     * 
     * @param ecdDesignCost 设计成本
     * @return 设计成本
     */
    @Override
    public List<EcdDesignCost> selectEcdDesignCostList(EcdDesignCost ecdDesignCost)
    {
        return ecdDesignCostMapper.selectEcdDesignCostList(ecdDesignCost);
    }

    /**
     * 新增设计成本
     * 
     * @param ecdDesignCost 设计成本
     * @return 结果
     */
    @Override
    public int insertEcdDesignCost(EcdDesignCost ecdDesignCost)
    {
        String uuid = UUID.randomUUID().toString();
        ecdDesignCost.setUid(uuid);

        return ecdDesignCostMapper.insertEcdDesignCost(ecdDesignCost);
    }

    /**
     * 修改设计成本
     * 
     * @param ecdDesignCost 设计成本
     * @return 结果
     */
    @Override
    public int updateEcdDesignCost(EcdDesignCost ecdDesignCost)
    {
        return ecdDesignCostMapper.updateEcdDesignCost(ecdDesignCost);
    }

    /**
     * 批量删除设计成本
     * 
     * @param ids 需要删除的设计成本主键
     * @return 结果
     */
    @Override
    public int deleteEcdDesignCostByIds(Long[] ids)
    {
        return ecdDesignCostMapper.deleteEcdDesignCostByIds(ids);
    }

    /**
     * 删除设计成本信息
     * 
     * @param id 设计成本主键
     * @return 结果
     */
    @Override
    public int deleteEcdDesignCostById(Long id)
    {
        return ecdDesignCostMapper.deleteEcdDesignCostById(id);
    }
}
